package com.example.asus.a1127;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.animation.TranslateAnimation;
import android.widget.ImageView;

public class TranslateActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_translate);
        ImageView imageView= (ImageView) findViewById(R.id.yzq);
        TranslateAnimation  translateAnimation =new TranslateAnimation(0,400,0,400);
        translateAnimation.setDuration(6000);
        imageView.startAnimation(translateAnimation);
       /*  Animation animation=AnimationUtils.loadAnimation(this,R.anim.translate);
        animation.setDuration(6000);
        animation.setFillAfter(true);
        imageView.startAnimation(animation);

        TranslateAnimation translateAnimation=new TranslateAnimation(Animation.RELATIVE_TO_PARENT,0f,
        Animation.RELATIVE_TO_PARENT,0.2f,Animation.RELATIVE_TO_PARENT,0.5f,Animation.RELATIVE_TO_PARENT,07f  );
       imageView.startAnimation(translateAnimation);*/
    }
}
